﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace V7Client
{
    /// <summary>
    /// Login.xaml 的交互逻辑
    /// </summary>
    public partial class Login : Window
    {
        public Login()
        {
            InitializeComponent();

            ResourceDictionary dict = new ResourceDictionary();
            dict.Source = new Uri("Russian.xaml", UriKind.Relative);
            this.Resources.MergedDictionaries.Clear();
            this.Resources.MergedDictionaries.Add(dict);
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            ResourceDictionary dict = new ResourceDictionary();
            if (btn_languageSwitch.Content.ToString()=="English")
            {
                btn_languageSwitch.Content = "Русский";
                dict.Source = new Uri("Russian.xaml", UriKind.Relative);
            }
            else
            {
                btn_languageSwitch.Content = "English";
                dict.Source = new Uri("English.xaml", UriKind.Relative);
            }

            this.Resources.MergedDictionaries.Clear();
            this.Resources.MergedDictionaries.Add(dict);
        }

        private void btn_login_Click(object sender, RoutedEventArgs e)
        {
            //校验 用户名合法

            MainWindow mainWindow = new MainWindow();
            mainWindow.Show();
            this.Close();
        }
    }
}
